import { GroupService } from './group.service';
import { Controller, Get, Query } from '@nestjs/common';

@Controller('group')
export class GroupController {
  constructor(
    private readonly groupService: GroupService
  ) {}

  // 获取单个群消息
  @Get('/message')
  getGroupMessage(@Query('group_id') group_id: string) {
    return this.groupService.getGroupMessage(group_id);
  }
  // 获取群成员
  @Get('/groupUser')
  getGroupUser(@Query('group_id') group_id: string) {
    return this.groupService.getGroupUsers(group_id);
  }

  // 通过名字查找群信息
  @Get('/findByName')
  getGroupByName(@Query('name') name: string) {
    return this.groupService.getGroupByName(name);
  }

  // 获取用户的所有群
  @Get('/userGroup')
  getUserGroup(@Query('user_id') user_id: string) {
    return this.groupService.getUserGroups(user_id);
  }
  
}
